package com.yuw.chuanzhi;

public class Student {
    // 属性
    // 姓名属性
    private String stuName;
    // 年龄
    private int stuAge;

    public Student(String stuName, int stuAge) {
        this.stuName = stuName;
        this.stuAge = stuAge;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuAge() {
        return stuAge;
    }

    public void setStuAge(int stuAge) {
        this.stuAge = stuAge;
    }

    // 行为
    ////////////////////////////这里一定要重写，否则打印的hashcode码/////////////////////////////////////
    @Override
    public String toString() {
        return "Student{" +
                "stuName='" + stuName + '\'' +
                ", stuAge=" + stuAge +
                '}';
    }

    /**
     * 打印学生信息
     */
    public void printMe() {
        System.out.println(this.toString());
    }
}
